<?php
/*
Plugin Name: Postreach ClickComments
Plugin URI: http://www.postreach.com/
Description: Plugin that allows your readers to comments by just clicking and without providing email addresses.
Version: 0.1
Author: Cain Chen, Hinablue.
Author URI: http://hina.ushiisland.net/blog/hinablue
*/ 

function ShowClickComments($target, $mother) {
	global $owner, $suri, $defaultURL, $blog, $entries;
	$slogan		= ($blog['useSloganOnPost'])? DBQuery::queryCell("SELECT slogan FROM {$database['prefix']}Entries WHERE owner = {$owner} AND id = {$mother}") : "";
	$permalink	= ($blog['useSloganOnPost'])? "{$defaultURL}/entry/{$slogan}" : "{$defaultURL}/{$mother}";

	$ClickComments = '';
	if($suri['directive']!="/rss" && $suri['directive']!="/m" && $suri['directive']!="/i/entry" && $suri['directive']!="/atom" && $suri['directive']!="/sync")
	{
		$ClickComments .= '<br /><div id="clickcomments_' . $mother .'" class="postreachclickcomments"><script type="text/javascript" src="http://www.postreach.com/ccengine/display_iframe?perlink=' . $permalink . '&amp;url=' . $defaultURL . '"></script></div>';
	}
	return $target . $ClickComments;
}

?>